function pmAdaptors_CreateFcn(h, e)
%PMADAPTORS_CREATEFCN Summary of this function goes here
%   Detailed explanation goes here

handles= guihandles(h);

ui.PopupMenu.Style={'style', 'PopupMenu', 'BackgroundColor', [1 1 1], 'units', 'normalized'};
set(h, ...
    'string', InstalledAdaptorsWithDevices, ...
    'tag', 'pmAdaptors');
set(h, ui.PopupMenu.Style{:});

Adaptor= getappdata(handles.dlgVideoInput, 'Adaptor');
if isempty(Adaptor)
    uicontrol_SelectedIndex(h, 1);
else
    uicontrol_SelectedItem(h, Adaptor);
end

end

function list=InstalledAdaptorsWithDevices

    list={};
    imaqhw= imaqhwinfo;
    InstalledAdaptors= imaqhw.InstalledAdaptors;
    
    for Adaptor= InstalledAdaptors
        imaqhw=imaqhwinfo(Adaptor{1});
        if numel(imaqhw.DeviceIDs) > 0
            list{end+1}= Adaptor{1};
        end
    end

end

